package com.huaxindata.im.model.entity;

public class ChatVoiceMessageBody extends ChatFileMessageBody {
    /**
     是否正在播放，用于应用使用
     */
     public boolean isPlay;

    /**
     语音时长, 秒为单位
     */
    public long duration;

    public ChatVoiceMessageBody(int type) {
        super(type);
    }

    public ChatVoiceMessageBody(String absolutePath) {
        super(Type.VOICE);
        this.localPath=absolutePath;
        createFileMessageContent(localPath);
        this.duration=getMediaLength(localPath);
    }


    public boolean isPlay() {
        return isPlay;
    }

    public void setPlay(boolean play) {
        isPlay = play;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    @Override
    public String toString() {
        return "ChatVoiceMessageBody{" +
                "isPlay=" + isPlay +
                ", duration=" + duration +
                '}';
    }
}
